IF AREA='1'
   SELE 1
   IF REC_LOCK(0)
      REPL ST_REORDER WITH .T.
      REPL ST_RE_PROP WITH .F.
      REPL ST_RE_QANT WITH NUM
   ENDIF
   UNLOCK
   sele 3
   if fil_lock(0)
      append blank
   endif
   if rec_lock(0)
      REPL DRUG_CODE  WITH KODE
      REPL DRUG_NAME  WITH NAME
      REPL DRUG_UNIT  WITH UNIT
      REPL DRUG_TYPE  WITH TIPE
      REPL DRUG_QANT  WITH QANT
      REPL BUY_UNIT   WITH BUYUNIT
      REPL U_PR_PURCH WITH PRIC
      REPL QANT_PURCH WITH NUM
      REPL VALU_PURCH WITH NUM*PRIC
      REPL SUPP_CODE  WITH SUPPCOD
      REPL SUPP_NAME  WITH SUPPNAM
      REPL DISC_PURCH WITH DISC
      REPL NET_PURCH WITH VALU
      REPL AEA_COMP WITH FREEP
   endif
   unlock
   RETURN
ELSE
   SELE 2
   IF REC_LOCK(0)
      REPL ST_REORDER WITH .T.
      REPL ST_RE_PROP WITH .F.
      REPL ST_RE_QANT WITH NUM
   ENDIF
   UNLOCK
   SELE 4
   if fil_lock(0)
    append blank
   endif
   if rec_lock(0)
      REPL DISP_CODE  WITH KODE
      REPL DISP_NAME  WITH NAME
      REPL DISP_UNIT  WITH UNIT
      REPL DISP_TYPE  WITH TIPE
      REPL DISP_QANT  WITH QANT
      REPL BUY_UNIT   WITH BUYUNIT
      REPL U_PR_PURCH WITH PRIC
      REPL QANT_PURCH WITH NUM
      REPL VALU_PURCH WITH NUM*PRIC
      REPL SUPP_CODE  WITH SUPPCOD
      REPL SUPP_NAME  WITH SUPPNAM
      REPL DISC_PURCH WITH DISC
      REPL NET_PURCH WITH VALU
      REPL AEA_COMP WITH FREEP
   endif
   unlock
ENDIF
SELE &AREA
RETURN